package com.dmx.fw.web.struts2.views.tags;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.TextareaTag;

import com.dmx.fw.web.struts2.components.ExtTextArea;
import com.opensymphony.xwork2.util.ValueStack;

public class ExtTextAreaTag extends TextareaTag {

	protected String pageState;
	protected String addState;
	protected String editState;
	protected String viewState;
	protected String code;
	protected String params;
	protected String outHidden;

	public Component getBean(ValueStack stack, HttpServletRequest req,
			HttpServletResponse res) {
		return new ExtTextArea(stack, req, res);
	}

	protected void populateParams() {
		super.populateParams();

		ExtTextArea extTextArea = ((ExtTextArea) component);
		extTextArea.setPageState(pageState);
		extTextArea.setAddState(addState);
		extTextArea.setEditState(editState);
		extTextArea.setViewState(viewState);
		extTextArea.setCode(code);
		extTextArea.setParams(params);
		extTextArea.setOutHidden(outHidden);

	}

	public void setPageState(String pageState) {
		this.pageState = pageState;
	}

	public void setAddState(String addState) {
		this.addState = addState;
	}

	public void setEditState(String editState) {
		this.editState = editState;
	}

	public void setViewState(String viewState) {
		this.viewState = viewState;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public void setOutHidden(String outHidden) {
		this.outHidden = outHidden;
	}

}
